package com.app.mvvmkotlindemo.request

import androidx.lifecycle.MutableLiveData
import com.app.mvvmkotlindemo.bean.DriverPersonalCenterBean
import com.app.mvvmkotlindemo.bean.UserBean
import com.everyline.baselibrary.base.viewmodel.BaseViewModel
import com.everyline.baselibrary.ext.request
import com.everyline.baselibrary.state.ResultState

import com.app.mvvmkotlindemo.network.HttpRequestManger

/**
 * Created by on 2020/12/1.
 * 天天挂线
 *  746608431@qq.com
 *  描述:TODO
 */

class RequestPersonModel : BaseViewModel() {
    var userBeanTokenData = MutableLiveData<ResultState<UserBean?>>()

    var driverPersonalCenterData = MutableLiveData<ResultState<DriverPersonalCenterBean?>>()

    fun driverPersonalCenter() {
        request(
            { HttpRequestManger.apiService.driverPersonalCenter() },
            driverPersonalCenterData,
            true
        )
    }

    fun driverLoginByToken(map: Map<String, String>) {
        request({ HttpRequestManger.apiService.driverLoginByToken(map) }, userBeanTokenData, false)

    }


}